﻿using System;
using System.Collections.Generic;
using System.Data;
using Common;
using DAL;
using Model;
using System.Data.SqlClient;

namespace BLL
{
    public class CodeMappingBll: BaseBLL
    {
        public CodeMappingBll(LoginInfo info)
        {
            loginInfo = info;
        }  
        public CodeMapping GetInfoById(string guid)
        {
            try
            {
                CodeMappingDAL dal = new CodeMappingDAL(loginInfo);
                return dal.GetInfoById(guid);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// 更新CodeMapping表记录
        /// </summary>
        /// <param name="pare">pare</param>
        public int Update(SqlParameter[] pare)
        {
            try
            {
                CodeMappingDAL dal = new CodeMappingDAL(loginInfo);
                return dal.Update(pare);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }/// <summary>
        /// 根据GUID字段获取CodeMapping实体对象
        /// </summary>
        /// <param name="dictionaryInfo"> </param>
        /// <returns>List<DictionaryInfo/>实体对象</returns>
        public List<CodeMapping> GetList(IDataParameter[] Info)
        {
            try
            {
                return new CodeMappingDAL(loginInfo).GetList(Info);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public string Delete(string id)
        {
            return new CodeMappingDAL(loginInfo).Delete(id);
        }
        public List<CodeMapping> GetMapping()
        {
            return new CodeMappingDAL(loginInfo).GetMapping();
        }
    }
}
